Repository navigation
Validation: ASP.NET Core, gRPC, GraphQL and Blazor integrations - #3385
Merged
david-driscoll merged 5 commits intoDec 4, 2026
Merged
david-driscoll merged 5 commits into
david-driscoll merged 5 commits into
Conversation
Four packages, each a joint that runs after its host package's and turns a ValidationFailedException into its transport's error shape, with the path, code, severity and placeholder values of every failure: - Validation.AspNetCore: a 422 ValidationFailedProblemDetails, the warnings of an accepted request in the Validation-Notices header, and an OpenAPI schema transformer that states the rules of the generated manifests. - Validation.Grpc: InvalidArgument with the failures in a binary trailer, and the warnings of a successful call in another. - Validation.HotChocolate: one VALIDATION error for each failure, and the warnings as an extension of the result. - Validation.Blazor: LaunchPadValidator, on .NET 11's asynchronous form validation: a field is validated alone when it changes, pending while a rule waits. The runtime gains what they share: ValidationFailedException and ThrowIfInvalid, ValidationNotices (ambient for the request being handled), ValidationJson, ValidationManifest (each validator's rules as data) and ObjectValidator (validation by a run-time type, with no reflection). The manifest marks conditional rules and rules about a collection's items. The API generators' schema rules read LaunchPad's rule attributes too. Validation in the mediator pipeline is not here: it waits for the mediator switch to land. Part of #3379. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
4 of 5 tasks
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 189 |
| Duplication | 5 |
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
2 of 3 tasks
|
Test Results 37 files + 4 37 suites +4 1h 36m 1s ⏱️ + 19m 40s Results for commit b2177c1. ± Comparison against base commit 5def661. This pull request removes 36 and adds 63 tests. Note that renamed tests count towards both.♻️ This comment has been updated with latest results. |
SummarySummary
CoverageRocket.Surgery.LaunchPad.Analyzers - 92.6%
Rocket.Surgery.LaunchPad.AspNetCore - 79.7%
Rocket.Surgery.LaunchPad.AspNetCore.Mvc - 86.1%
Rocket.Surgery.LaunchPad.EntityFramework - 100%
Rocket.Surgery.LaunchPad.Foundation - 87.5%
Rocket.Surgery.LaunchPad.Foundation.Tasks - 83.9%
Rocket.Surgery.LaunchPad.Grpc - 100%
Rocket.Surgery.LaunchPad.Hosting - 100%
Rocket.Surgery.LaunchPad.HotChocolate - 35.7%
Rocket.Surgery.LaunchPad.NodaTime - 97.4%
Rocket.Surgery.LaunchPad.NodaTime.HotChocolate - 100%
Rocket.Surgery.LaunchPad.NodaTime.StrawberryShake - 100%
Rocket.Surgery.LaunchPad.Primitives - 100%
Rocket.Surgery.LaunchPad.Primitives.Analyzers - 96.4%
Rocket.Surgery.LaunchPad.Spatial - 83%
Rocket.Surgery.LaunchPad.StrawberryShake - 100%
Rocket.Surgery.LaunchPad.StrawberryShake.Spatial - 44.8%
Rocket.Surgery.LaunchPad.Validation - 72.9%
Rocket.Surgery.LaunchPad.Validation.Analyzers - 95.5%
Rocket.Surgery.LaunchPad.Validation.AspNetCore - 90.5%
Rocket.Surgery.LaunchPad.Validation.Blazor - 100%
Rocket.Surgery.LaunchPad.Validation.Grpc - 100%
Rocket.Surgery.LaunchPad.Validation.HotChocolate - 98%
Rocket.Surgery.LaunchPad.ZeroAlloc.AspNetCore - 65.5%
Sample.BlazorServer - 27.6%
Sample.BlazorWasm - 19.2%
Sample.Classic.Restful - 8.5%
Sample.Command - 7.2%
Sample.Core - 86.2%
Sample.Graphql.Executable - 85.8%
Sample.Grpc - 85.1%
Sample.Minimal - 70.7%
Sample.Pages - 13%
Sample.Restful - 71.7%
Sample.Worker - 2.9%
|
…ntegrations # Conflicts: # test/Api.Generators.Tests/OpenApiGeneratorTests.cs
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
david-driscoll
marked this pull request as ready for review
December 4, 2026 06:20
david-driscoll
enabled stacked auto-merge
December 4, 2026 06:21
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Phase 5 of LaunchPad's own validation (#3374), for #3379. Stacked on #3384, which is stacked on #3382.
What changes
Four new packages, each a joint that runs after its host package's and turns a
ValidationFailedExceptioninto its transport's error shape. Every failure carries its path, code, severity and the values of its message's placeholders.Rocket.Surgery.LaunchPad.Validation.AspNetCoreValidationFailedProblemDetails, errors by pathValidation-Noticesheader (JSON)Rocket.Surgery.LaunchPad.Validation.GrpcInvalidArgument, failures in thevalidation-failures-bintrailervalidation-notices-bintrailerRocket.Surgery.LaunchPad.Validation.HotChocolateVALIDATIONerror per failurevalidationNoticesresult extensionRocket.Surgery.LaunchPad.Validation.BlazorLaunchPadValidatorreports to the formValidationOpenApiSchemaTransformerstates the rules of each validated type from its generatedValidationManifest, whichever way they were declared (attributes, aValidatefunction, a base class, an interface,[InheritFrom]). The API generators' build-timeSchemaRulesread LaunchPad's rule attributes beside ZeroAlloc.Validation's.EditContext.IsValidationPending) while a rule waits;ValidateAsyncawaits the whole model. The validator is found by the model's run-time type with no reflection.ValidationFailedExceptionandThrowIfInvalid(),ValidationNotices,ValidationJson,ValidationManifestandObjectValidator.Decisions worth a look
These were mine to make while building; say if you want any of them different.
noticesmember of the problem details and thevalidationNoticesextension are new. Placeholder values are sent as text, so no JSON context needs an entry per value type.Stages[2].Thrustis not a valid metadata key.ValidationNoticesis ambient (anAsyncLocala transport begins), registered scoped as the one of the request being handled. HotChocolate gives each query resolver its own scope, so a plain scoped service never reached the response.Not in this pull request
main, so that item of Validation: transport and framework integrations #3379 stays open. Until it does, nothing throwsValidationFailedExceptionbut an application's own code, and "requests are validated before their handler" is not yet true.src/ZeroAlloc.*packages, their tests and the SDK's detection of them stay until Validation: port the samples and remove ZeroAlloc.Validation #3380.Test plan
test/Validation.AspNetCore.Tests(9): problem details, the JSON context path, the warning header through a test server, and the OpenAPI schema snapshot.test/Validation.Grpc.Tests(6),test/Validation.HotChocolate.Tests(4),test/Validation.Blazor.Tests(8, including a field pending on an asynchronous rule).test/Api.Generators.TestsOpenApiGeneratorTests(14, 2 new for LaunchPad's attributes).test/Validation.Tests(72) andtest/Validation.Analyzers.Tests(16) with the manifest changes.mise run buildon CI.🤖 Generated with Claude Code